package org.dromara.system.mapper;

import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.system.domain.VariableAssociation;
import org.dromara.system.domain.VariableAssociationGroup;
import org.dromara.system.domain.vo.VariableAssociationVo;

import java.util.Collection;
import java.util.List;

/**
 * 变量Mapper接口
 *
 * @author Lion Li
 * @date 2024-10-21
 */
public interface VariableAssociationMapper extends BaseMapperPlus<VariableAssociation, VariableAssociationVo> {


    int updateVariableAssociationGroupZero(@Param("groupId") Long groupId);

    int updateVariableAssociationName(@Param("id") Long id, @Param("name") String name);

    String getGroupNameById(@Param("groupId") Long groupId);

    List<VariableAssociationGroup> getVGroupNamesByIds(@Param("groupIds") List<Long> groupIds);

    int updateVariableAssociation(@Param("groupId") Long groupId, @Param("ids") Collection<Long> ids);

    void updateVariableAssociationValue(@Param("id") Long id, @Param("value") String v);

    String getVariableAssociationName(@Param("id") Long deviceId);

    String getVariableAssociationUnit(@Param("id") Long deviceId);

    VariableAssociation findByCode(@Param("code") String code);

    void updateDeviceStatus(@Param("id") Long deviceId, @Param("status") int status);


    VariableAssociation findPhoneByNumber(@Param("code") String extensionNumber, @Param("pileNumber") String extensionPileNumber);

    void updateVariableAssociationStatus(Long id, @Param("status") int status);

    Long getTunnelIdByVariableId(@Param("variableId") Long variableId);

    void updateDeviceStatusBySensorId(long sensorId);
}
